<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
    </head>
    <body>
    <script type="text/javascript">
        var loopImage=function(imgarr,container){
            this.imageArray=imgarr;
            this.container=container;
            this.createImage=function(){}
            this.changeImage=function(){}
        }
        var SlideLoopImg=function(imgarr,container){
            //继承
            loopImage.call(this,imgarr,container)
            //重写方法
            this.changeImage=function(){
                console.log('SlideLoopImg changeImage function')
            }
        }
        var FadeLoopImage=function(imgarr,container,arrow){
             loopImage.call(this,imgarr,container)
             this.arrow=arrow//切换箭头私有变量
             this.changeImage=function(){
                console.log('FadeLoopImage changeImage function')
             }
        }
        var fadeImg=new FadeLoopImage([
            '01.jpg','02.jpg','03.jpg'],'slide',['left.jpg','right.jph'])
        fadeImg.changeImage()
    </script>
    </body>
</html>